package com.lmz.project.redis.controller;

import com.lmz.project.redis.service.OrderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
@Tag(name = "控制器：测试Swagger3", description = "描述：测试Swagger3")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/addOrder")
    @Operation(summary = "添加订单")
    public void addOrder(){
        orderService.addOrder();
    }

    @GetMapping("/getOrder")
    @Operation(summary = "获取订单")
    public String getOrder(@RequestParam(name = "keyId") int keyId){
        return orderService.getOrder(keyId);
    }
}
